package com.example.userprovider.controller;

import com.example.userprovider.mapper.UserMapper;
import com.myshop.b2b.commonmodule.User;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author likaiping
 * @createTime 2024/7/2 17:27
 */
@RestController
public class UserController {
    @Resource
    private UserMapper userMapper;

    @GetMapping("/register")
    public int register(@RequestParam(value = "upassword")String upassword, @RequestParam(value = "uname")String uname,
                        @RequestParam(value = "usex") String usex){
        return userMapper.register(upassword,uname,usex);
    }

    @GetMapping("/login")
    public User login(@RequestParam("uname") String uname){
        return userMapper.login(uname);
    }
}
